Data races are a common defect occurring in concurrent code. A data race occurs when multiple accesses to the same memory location occur concurrently, including at least one write, such that the contents of the memory location may be overwritten before it is read by another concurrent access. One technique used to detect concurrency problems is happens-before-based dynamic analysis, which analyzes concrete program executions and determines happens-before ordering relations between executed operations, and hence which operations may be executed concurrently.
However, conventional happens-before-based dynamic analysis has limitations when applied to programs based on the actor concurrent programming model. In the actor model, programs are composed of actors that communicate via asynchronous message passing. An actor, upon receiving a message, may perform local operations, create more actors, send messages, and/or change its local state. Though the code of each actor is executed sequentially, multiple actors may process messages concurrently. When conventional happens-before-based dynamic analysis is applied to the execution of actor-based programs, only the particular actor execution order observed during the analyzed execution is considered. The conventional approach does not address the potential for actor scheduling and thread allocation to be different in different executions, and therefore does not cover all possible execution orderings, which can result in some concurrency defects going undetected. Reliably detecting concurrency defects using the conventional approach would require performing the analysis on a different execution order for every possible actor schedule, which is not a scalable solution.